<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <!-- <script src="./axios.min.js"></script> -->
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    
</head>
<body>
    <div id="app">
        <el-row>
            <el-col :span="4">
                <el-input v-model="account" placeholder="用户名" size="small"></el-input>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="4">
                <el-input v-model="password" placeholder="密码" size="small"></el-input>
            </el-col>
        </el-row>
        <el-row>
            <el-button type="primary" @click="register" size="small">注册</el-button>
        </el-row>
    </div>

</body>
<script>
    var app=new Vue({
        el:'#app',
        data(){
            return {
                account:"",
                password:""
            }
        },
        methods:{
            register(){
                var user={
                    account:this.account,
                    password:this.password
                }
                var url="http://39.106.84.227:8089/register"
                $.post({
					url,
					method:"post",
					contentType:"application/json",
					data:JSON.stringify(user),
                    success:function(data){
                        console.log(data);
                    }
  					});

            }
        }
    })
</script>
</html>